Modern microcontroller systems usually comprise several types of memory adapted to store different types of data. Conventionally, a microcontroller comprises a volatile memory (RAM) section and a non-volatile memory section, such as a ROM, EPROM, EEPROM, or Flash memory. The volatile memory section serves as the microcontroller's main memory and is used, among other things, to store programs that are being executed. The non-volatile memory section is used to store program data and operating parameter data.
The non-volatile memory systems of such microcontrollers are sometimes partitioned into two physically separate sections. Such microcontroller systems are employed, for example, in the automotive sector. The two physically separate sections of the non-volatile memory are then conveniently used to store two different types of data: program data and application data. Therefore, the first section of non-volatile memory may be provided to store program data and the second section of non-volatile memory may be provided to store application data. The program data is usually written to the memory just once and, after it has been written, is read from the memory many times. In contrast, the application data is written to and read from the memory repeatedly. Since the two sections of non-volatile memory are physically separate, the two sections can be accessed independently from each other. A first portion of data may, for example, be read from the first section, while, at the same time, a second portion of data is being written to the second section.
To make optimal use of this independent access to the two memory sections, one of the two sections should be used exclusively to store program data, whereas the other section should be used exclusively to store application data. Then, program data and application data can be accessed independently from each other. In many applications of microcontrollers in the automotive sector, however, this is not the case and program data is not cleanly separated from application data. Motor control tables, for example, are often stored in the memory section provided to store program data.
A problem arises when data which is stored in the memory section provided to store program data, such as the motor control tables mentioned above, needs to be accessed while a program is being executed by the microcontroller. Since the motor control tables are stored in the memory section that also contains the program data, i.e. the program code that is frequently accessed during execution of a program, accessing the motor control tables often requires interrupting a read access to the program code. This results in inefficient program execution and an overall loss of efficiency.
To solve the problem described above, usually one of the following two approaches is applied. Either the Flash memory is designed to allow access to the Flash memory to be interrupted very quickly. To achieve quick interrupts, the sense amplifiers provided in the Flash memory need to be in operation constantly, thus constantly drawing current. In addition, the circuitry needed to allow quick interrupts requires additional space. Or a second quick cache memory which is arranged between the Flash memory and the microprocessor of the microcontroller is enlarged. Cache memory typically consists of SRAMs which require a lot of space and draw a lot of current.
With the first approach the drawbacks of an interrupt are reduced but not eliminated. With the second approach the frequency of interrupts can be reduced. Factors influencing the frequency of interrupts are the program which is being executed, the cache hit rate, and the size of the cache. With the second approach there will still be interrupts, but these will occur less frequently.
For these or other reasons there is a need for an improved system and/or method to store data in an adjustably partitionable memory array.